
local raw = ...
local select = select

local raw_image = raw.image

local rendercache = {}

return {
	image = raw.image;
	line = raw.line;
	pixel = raw.pixel;
	box = raw.box;
	text = function(target, font, txt, x,y, ...)
		local r,g,b,a;
		local argc = select('#', ...);
		if (argc == 1) then
			r,g,b,a = target:rgba(...);
		elseif (argc == 3) then
			r,g,b = ...;
			a = 255;
		elseif (argc == 4) then
			r,g,b,a = ...;
		elseif (argc == 0) then
			r,g,b,a = 255,255,255,255;
		end
		local render = font:solid(txt,r,g,b,a);
		raw_image(target,render,x,y);
--		render:destroy();
	end;
}